<template>
	<view class="">
		<ls-page title='首页' :hidden="true" :userIdentity='0' leftIcon='' :autoBack='false'>
			<view class="home-container">
				<view class="top-contianr">
					<image v-if="themetype == '002'" class="meng-top"
						src="https://oss.jtmckj.com/wmp/kbq/home/i_icon_meng.png" mode="" />
					<image class="banner"
						:src="shopInfo?.miniBackgroundImage ? shopInfo?.miniBackgroundImage : 'https://jtmc.oss-cn-hangzhou.aliyuncs.com/wmp/qnjg/index/banner.png' "
						mode="" />
					<image v-if="themetype == '002'" class="meng-bottom"
						src="https://oss.jtmckj.com/wmp/kbq/home/i_icon_meng1.png" mode="" />
					<image v-if="themetype == '001'"
						style="background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, black 100%);"
						class="meng-bottom" src="https://oss.jtmckj.com/wmp/kbq/home/i_icon_meng1.png" mode="" />
				</view>
				<view class="top-content">
					<view class="content-box">
						<view class="home-wifi">
							<!-- <view class="home-wifi-button">
							<image class="home-wifi-image" src="https://oss.jtmckj.com/wmp/images/home/index/i_icon_wifi.png" mode="aspectFill"> </image>
							<text class="home-wifi-text">一键链接</text>
						</view> -->
						</view>
						<view class="home-main">
							<view class="home-main-heading">
								<view class="home-main-user">
									<view class="home-main-user__cover"
										:style="'background-image: url(' + (userInfo.attachment ? userInfo.attachment : 'https://oss.jtmckj.com/wmp/images/common/i_default_avatar.png' ) + ')'">
									</view>
									<view class="home-main-user__nickname">{{userInfo.name}}</view>
								</view>
								<view>
									<view class="home-main-location" @click="onLocation">
										{{shopInfo?.orgName ? shopInfo.orgName : ''}}
									</view>
									<view class="home-main-table" v-if="storeTableInfo">当前桌台：{{storeTableInfo.name}}
									</view>
								</view>
							</view>
							<view class="home-top-menu">
								<view class="home-top-menu-item" @click="SacnOrder">
									<view class="menu-title">点单</view>
									<view class="menu-eTitle">Scan QR code order</view>
									<view class="menu-table" v-if="storeTableInfo.name">
										{{storeTableInfo.name}}台
										<image class="menu-table-img" src="https://jtmc.oss-cn-hangzhou.aliyuncs.com/wmp/common/i_tra-qnjg.png"mode="scaleToFill" />
										
									</view>
									<image v-else
										src="https://jtmc.oss-cn-hangzhou.aliyuncs.com/wmp/qnjg/index/i_menu_scan.png"
										mode="scaleToFill" />
								</view>
								<view class="home-top-menu-item"
									@click="topath('/subpkg/view/centerStore/centerStore')">
									<!-- <view class="home-top-menu-item"
											@click="Share"> -->
									<view class="menu-title">储值</view>
									<view class="menu-eTitle">Stored value</view>
									<image
										src="https://jtmc.oss-cn-hangzhou.aliyuncs.com/wmp/qnjg/index/i_menu_stored.png"
										mode="scaleToFill" />
								</view>
							</view>

							<view class="home-bottom-menu">
								<view class="home-bottom-menu-item" v-for="(v,k) in menuList2" :key="k"
									@click="onCustom(v.title)">
									<image :src="v.icon" mode="scaleToFill" />
									<view>{{v.title}}</view>
								</view>
							</view>

							<view class="home-banner">
								<view class="home-banner-up" v-if="showUp"
									:style="'background-image: url(' + showUpBacImg + ')'">
									<view class="upgrade" @click="PayMemberUp">立即升级</view>
								</view>
								<image style="border-radius: 16rpx;" v-for="(v,k) in shopInfo?.bottomList" @click="toAdvOther(v)" :key="k"
									:src="v.carouselPic" mode="widthFix" />
							</view>
						</view>
					</view>
				</view>
			</view>
		</ls-page>
		<!-- 存取酒 -->
		<x-popup position="center" :show="showWine" :closeIcon="true" :closeOnClickOverlay="true"
			@update:show="showWine = $event">
			<view class="popup-wine" style="width: 480rpx;">
				<view class="popup-wine-title">当前桌台：<text class="titleName">{{storeTableInfo.name}}</text></view>
				<view style="height:60rpx"></view>
				<view class="popup-wine-control">
					<view class="popup-wine-btn" bind:tap="onWineThrottle" @click="onWine('set')">我要寄存</view>
					<view class="popup-wine-btn" bind:tap="onWineThrottle" @click="onWine('get')">我要取酒</view>
				</view>
			</view>
		</x-popup>
		<!-- 呼叫服务 -->
		<x-popup position="center" :show="callShow" :closeIcon="true" :closeOnClickOverlay="true" @close="customService"
			@update:show="callShow = $event">
			<view class="popup-wine">
				<view class="popup-wine-top">
					<view class="top-title" style="color:var(--maincolorf1)">
						当前桌台：{{storeTableInfo.name}}
					</view>
					<!-- <view class="top-value">
				      {{table?table:''}}
				    </view> -->
				</view>
				<view style="height:60rpx"></view>
				<view class="popup-wine-control">
					<view class="popup-wine-btn" @click="onCall('get')">呼叫</view>
					<view class="popup-wine-btn" @click="onCall('set')">扫码呼叫</view>
				</view>
			</view>
		</x-popup>
		<upPop v-if="upShow" :show="upShow" @update:show="upShow = $event" @upFine="upFine(e)" />
		<x-popup position="center" :show="activityShow" :closeOnClickOverlay="true" @close="activityShow = false">
			<view class="activityShow-content">
				<view class="activityShow-title" style="color:var(--maincolorf1)">
					{{shopInfo.sendCouponRemark}}
				</view>
				<view style="height:60rpx">
					(预计2~3分钟内到账)
				</view>
				<view class="activityShow-btn" @click="topath('优惠券')">
					快去领取吧
				</view>
			</view>
		</x-popup>
		<x-popup class="adv-popup" position="center" v-if="shopInfo.headerPicture" :show="showAdv" :closeOnClickOverlay="true"
			@close="showAdv = false" closeImag="https://oss.jtmckj.com/h5-uniapp/qnig/my/close-write.png">
			<image @click.stop="showAdv = false" class="close"
				src="https://jtmc.oss-cn-hangzhou.aliyuncs.com/wmp/qnjg/common/i_close.png"></image>
			<!-- <image @click="topath('/subpkg/view/centerStore/centerStore')" class="wh100"
				src="https://jtmc.oss-cn-hangzhou.aliyuncs.com/wmp/qnjg/common/i_adv.jpg"></image> -->
			<image @click="topath('/subpkg/view/centerStore/centerStore')" class="wh100"
				:src="shopInfo.headerPicture"></image>
		</x-popup>
	</view>



</template>

<script setup>
	import { onLoad, onReachBottom, onPullDownRefresh, onShow, onHide, onPageScroll } from '@dcloudio/uni-app';
	import { ref } from 'vue';
	import { initStatusBarHeight } from "@/until/tools.js"
	import { HFiveAppObjProcess, HFiveMemberAppObjProcess, GetMinimsgTemplate, GetBaseConfigInfoH5 } from '@/api/public.js'
	import {
		getWeChatJsSDKConfig,
		_ExtractParamsFromPath,
		initTableInfoFinish,
		initTableInfo,
		updateTableInfo
	} from '@/until/tools.js'
	import wx from "weixin-js-sdk";
	import { useTableStore } from '@/store/table.js';

	const themetype = uni.getStorageSync('themeInfo')?.type 
	// -------------------------------------------------------初始化数据-----------------------------------------------------
	const shopInfo = uni.getStorageSync('shopInfo') //门店信息
	const userInfo = ref({}) //用户信息
	const tableInfo = uni.getStorageSync('tableInfo') //桌台信息 
	const callForm = ref({
		memberMsgType: "", // 001 呼叫服务员  002 申请存酒
		memberName: "",
		memberMobile: "",
		roomCode: "",
	})
	const navbarHeight = computed(() => {
		return initStatusBarHeight() || 200;
	});
	const storeTableInfo = ref({
		code: '',
		name: ''
	})

	const address = ref('')
	const toPing = () => {
		console.log('跳转到 Ping 页面');
	};

	const globalData = ref({})

	let params = ref({
		brandCode: '', //品牌必传
		org: '', // 门店必传
		link: '', // 调转的小程序path必传
		code: '',
		name: '',
		version: 'trial', //  trial 为体验版  release 正式版
	})

	const SDKConfig = ref({})

	const tableName = ref("") // 当前房台
	const tableCode = ref("") // 当前房台编号
	const menuList2 = ref([{
			icon: "https://jtmc.oss-cn-hangzhou.aliyuncs.com/wmp/qnjg/index/i_menu_wine.png",
			title: "存取酒",
			type: "primary",
			url: "custom",
		},
		{
			icon: "https://oss.jtmckj.com/public/icon/yd-icon.png",
			title: "预订",
			type: "primary",
			url: "custom",
		},
		{
			icon: "https://jtmc.oss-cn-hangzhou.aliyuncs.com/wmp/qnjg/index/i_menu_community.png",
			title: "进群拼桌",
			type: "primary",
			url: "custom",
		},
		{
			icon: "https://jtmc.oss-cn-hangzhou.aliyuncs.com/wmp/qnjg/index/i_menu_shop.png",
			title: "优惠商城",
			type: "primary",
			url: "custom",
		},
		{
			icon: "https://oss.jtmckj.com/wmp/qnjg/index/i_menu_feeBack.png",
			title: "投诉建议",
			type: "primary",
			url: "/pages/center/feedback/index",
		},
	])

	const BottomList = ref([{
			"Code": null,
			"CarouselPic": "https://oss.jtmckj.com/backend/Organize/2e0ea96a64df4e519fa42a5800ca62ec.png",
			"CarouselUrl": "2",
			"CarouselType": "2",
			"CarouselUrlType": "",
			"BrandMinisetingCode": null
		},
		{
			"Code": null,
			"CarouselPic": "https://oss.jtmckj.com/backend/Organize/8865a66a563a4a689b18195415e292b7.png",
			"CarouselUrl": "1",
			"CarouselType": "2",
			"CarouselUrlType": "",
			"BrandMinisetingCode": null
		}
	]);
	const showUpBacImg = ref('')
	const userAvatar = ref('https://oss.jtmckj.com/wmp/images/common/i_default_avatar.png')
	const showUp = ref(false)
	const upShow = ref(false)
	// -------------------------------------------------------初始化数据-----------------------------------------------------
	const topath = (url) => {

		if (url == '优惠券') {
			activityShow.value = false
			uni.switchTab({
				url: '/pages/coupon/index'
			})
		}
		showAdv.value = false
		uni.navigateTo({
			url: url
		})
	}
	const toAdvOther = (v)=>{
		if (!v.carouselUrl) {
		      return
		}
		if(v.carouselUrlType == '1'){ // 外部网页
			window.location.href =  v.carouselUrl
		}else if(v.carouselUrlType == '2'){ // 外部小程序
			
		}else if(v.carouselUrlType == '3'){ // 内部小程序
			uni.navigateTo({
				url: v.carouselUrl
			})
		}
		
	}

	//----------------------------------------------------------------------------点单扫码----------------------------------------------------------------------
	const SacnOrder = async () => {
		const shopInfo = await GetBaseConfigInfoH5()
		console.log(shopInfo);
		if (shopInfo && shopInfo.isCloseMiniOrder) {
			uni.showToast({ title: "门店已关闭点单功能", icon: "none" });
			return
		}
		// console.log(uni.getStorageSync('tableInfo'));
		let res = uni.getStorageSync('tableInfo')
		if (res && res.code) {
			// RoomOpenFun('order') // 扫码开台
			uni.navigateTo({
				url: '/pagesOrder/view/goods/index'
			})
			updataTableFun(res.code) 
		} else {
			// // 测试
			// let code = '0017093'
			// updataTableFun(code)
			// return
			uni.removeStorageSync('tableInfo')
			wx.config({
				debug: false, // 开启调试模式,
				appId: SDKConfig.value.appId, // 必填，企业号的唯一标识
				timestamp: SDKConfig.value.timestamp, // 必填，生成签名的时间戳
				nonceStr: SDKConfig.value.nonceStr, // 必填，生成签名的随机串
				signature: SDKConfig.value.signature, // 必填，签名
				jsApiList: ['scanQRCode'], // 必填，需要使用的JS接口列表
			});
			wx.ready((res) => {
				wx.scanQRCode({
					needResult: 1, // 默认为0，扫描结果由微信处理，1则直接返回扫描结果，
					scanType: ['qrCode', 'barCode'], // 可以指定扫二维码还是一维码，默认二者都有
					success: function(res) {
						if (res.resultStr) {
							const options = _ExtractParamsFromPath(res.resultStr);
							if (!options.code) {
								uni.showToast({ title: "二维码出错", icon: "none" });
								return
							}
							updataTableFun(options.code)
							uni.navigateTo({
								url: '/pagesOrder/view/goods/index'
							})
						
						}
					},
					fail: function(response) {
						uni.showToast({ title: "请扫描正确的二维码", icon: "none" });
					},
				});
			})
		}
	}

	// 
	const updataTableFun = async (code) => {
		console.log(code);
		let obj = {
			code: code
		}
		uni.setStorageSync('tableInfo', obj) // initTableInfo方法会更新 先存一个code就行
		const result = await updateTableInfo(code) // 更新后台房台
		const tableInfo = await initTableInfo() // 更新本地房台
		storeTableInfo.value = uni.getStorageSync('tableInfo')
		console.log('tableInfo:', tableInfo)
		if(shopInfo && shopInfo.isOpenRoom) {
		   await RoomOpenFun()
		}
	}


	// 扫码成功，则默认自动开台操作，如果开台失败则需联系线下服务员开台
	const RoomOpenFun = (typeName) => {
		let modal = {
			"functionName": "MemberRoomOpen_H5",
			"contentData": {
				"memberName": userInfo.name,
				"memberMobile": userInfo.mobile,
				"memberOpenid": userInfo.openId,
				"sex": userInfo.sex,
				"roomCode": storeTableInfo.value.code
			}
		}
		HFiveMemberAppObjProcess(modal)
	}

	// 其它 other
	const toOther = (v) => {
		// params.value.link = 'other'
		// console.log('点击了~其它');
		// publicToWx()
		if (v == '优惠商城') {
			uni.navigateTo({
				url: '/pagesPointShop/view/index'
			})
		} else if (v == '拼桌') {
			uni.navigateTo({
				url: '/pagesSquare/index'
			})
		}
	};

	const baseConfig = ref(null)
	//获取初始获取门店信息
	const getBaseConfigInfo = () => {
		baseConfig.value = uni.getStorageSync('shopInfo')

	}

	const bgColor = ref('transparent');

	// 一定要有参数 否则白瞎
	onLoad(async (options) => {

		params.value.brandCode = options.brd // ||  '0005'
		params.value.org = options.org // || '0018'
		params.value.link = options.link
		params.value.code = options.code
		params.value.name = options.name
		console.log('options-params', params.value)
		globalData.value = options
		// const globalData = uni.getStorageSync('globalData')
		// console.log(globalData, 'globalData')
		getActivity()
		getBaseConfigInfo()
		getWeChatJsSDKConfig().then(resking => {
			SDKConfig.value = resking
			// if(resking) {

			// }
		})


		getUserInfo()
	});

	const Share = () => {
		getShareJSSDK(SDKConfig.value, shareData.value)
	}
	const showAdv = ref(false)
	onShow(async () => {
		let res = await initTableInfoFinish() // 拉取用户桌台信息
		if (res.currentRoomName) {
			tableCode.value = res.currentRoomCode
			uni.setStorageSync('tableInfo', { // 存到本地
				code: res.currentRoomCode,
				name: res.currentRoomName
			})
		} else {
			uni.removeStorageSync('tableInfo')
		}
		storeTableInfo.value = uni.getStorageSync('tableInfo') || {} // 获取本地数据
		userInfo.value = uni.getStorageSync('userInfo') // 获取用户信息

		let toolAdv = uni.getStorageSync('showAdv')
		if (toolAdv) { // 弹一次广告就行
			showAdv.value = true
			uni.removeStorageSync('showAdv')
		} else {
			showAdv.value = false
		}

	})

	const callShow = ref(false)
	const showWine = ref(false)

	const customService = () => {
		console.log('11')
		callShow.value = false
	}
	const onWine = (type) => {
		if (type == "set") {
			// 存酒呼叫
			callWaiter("002", tableCode.value);


		} else {

			userInfo.value.tableCode = tableCode.value;
			showWine.value = false
			// if (app.global.isMember) {
			// this.navTo("/pages/center/onWine/index");
			uni.navigateTo({
				url: '/subpkg/view/accessCohol/accessCohol'
			})
			// }


		}
	}

	// 存取酒-呼叫服务
	const callWaiter = (type, roomCode) => {
		if (!roomCode) {
			uni.showToast({ title: "请先扫码获取房台", icon: "none" });
			return
		}
		callForm.value.memberName = userInfo.value.name;
		callForm.value.memberMobile = userInfo.value.mobile;
		callForm.value.memberMsgType = type;
		callForm.value.roomCode = roomCode;
		HFiveMemberAppObjProcess({
			functionName: "CallWaiter_H5",
			contentData: callForm.value,
		}).then((res) => {
			console.log(res, 'res-----------')
			// 此处 特殊业务 后再调整 0015这家门店要求提示改成这个，正常统一调整
			if (uni.getStorageSync('shopInfo').orgCode === '0015') {
				uni.showToast({ title: '请举灯', icon: "none", duration: 2500 });
			} else {
				uni.showToast({ title: res.data, icon: "none" });
			}
			showWine.value = false
			callShow.value = false
		});
	}


	// 客观吩咐-呼叫服务
	const onCall = (type) => {

		if (type == "set") {

			wx.config({
				debug: false, // 开启调试模式,
				appId: SDKConfig.value.appId, // 必填，企业号的唯一标识
				timestamp: SDKConfig.value.timestamp, // 必填，生成签名的时间戳
				nonceStr: SDKConfig.value.nonceStr, // 必填，生成签名的随机串
				signature: SDKConfig.value.signature, // 必填，签名
				jsApiList: ['scanQRCode'], // 必填，需要使用的JS接口列表
			});
			wx.ready((res) => {
				wx.scanQRCode({
					needResult: 1, // 默认为0，扫描结果由微信处理，1则直接返回扫描结果，
					scanType: ['qrCode', 'barCode'], // 可以指定扫二维码还是一维码，默认二者都有
					success: function(res) {
						if (res.resultStr) {
							const options = _ExtractParamsFromPath(res.resultStr);
							if (!options.code) {
								uni.showToast({ title: "二维码出错，请联系服务开台", icon: "none" });
								return
							}
							// 存酒扫码
							callWaiter("001", options.code);
						}
					},
					fail: function(response) {
						uni.showToast({ title: "请扫描正确的二维码", icon: "none" });
					},
				});
			})

		} else {
			if (!tableCode.value) {
				uni.showToast({ title: "未选桌台，请扫码呼叫", icon: "none" });
				return;
			}
			// 呼叫
			callWaiter("001", tableCode.value);
		}
	}



	const onCustom = (v) => {
		if (v == '存取酒') {
			console.log('fsdf')
			showWine.value = true
		} else if (v == '预订') {
			uni.navigateTo({
				url: '/subpkg/view/book/book'
			})
		} else if (v == '进群拼桌') {
			// uni.navigateTo({
			// 	url: '/pagesSquare/index'
			// })
			window.location.href = shopInfo.workWecharQrCode
		} else if (v == '优惠商城') {
			uni.navigateTo({
				url: '/pagesPointShop/view/index'
			})
		} else if (v == '投诉建议') {
			uni.navigateTo({
				url: '/subpkg/view/feedBack/feedBack'
			})
		}
	}

	const onLocation = () => {
		uni.navigateTo({
			url: '/subpkg/view/switchStores/switchStores'
		})
	}

	// 获取会员信息
	const getUserInfo = () => {
		// 获取会员信息
		HFiveMemberAppObjProcess({ functionName: "MemberInfo_H5", contentData: "" }).then((res) => {
			console.log('获取会员信息:', res)
			// 判断是否显示：立即升级模块组件
			res.forEach((item) => {
				//必须满足3个条件： 门店卡cardType:2   未升级memberIsPayCard：0   允许充值isPayCard:1
				if (item.cardType === 2 && item.memberIsPayCard === "0" && item.isPayCard === "1") {
					// if(item.cardType === 2 && item.memberIsPayCard === "0" && item.isPayCard === "0"){  
					showUp.value = true
					if (item.backgroundAtt) {
						showUpBacImg.value = item.backgroundAtt
					} else {
						// 未配置背景图片 则用默认图
						showUpBacImg.value =
							'https://jtmc.oss-cn-hangzhou.aliyuncs.com/public/diandan/def-up-vip2.png'
					}
				}
			})

		});
	}

	const PayMemberUp = () => {
		upShow.value = true
	}
	const activityShow = ref(false)
	const  getActivity = ()=>{
		let shopInfo = uni.getStorageSync('shopInfo')
		if(shopInfo && shopInfo.setSendCoupon && uni.getStorageSync('NewMember')){
			  activityShow.value = true
			  uni.removeStorageSync('NewMember')
		}
	}
</script>
<style scoped lang="less">
	.top-contianr {
		height: 750rpx;
		position: absolute;
		// position: relative;
		top: 0;
		left: 0;
		width: 100%;
		z-index: 1;

		.meng-top {
			width: 100%;
			height: 200rpx;
			position: absolute;
			top: 0;
			left: 0;
			z-index: 10;
		}

		.banner {
			width: 100%;
			height: 750rpx;
			z-index: 10;
		}

		.meng-bottom {
			width: 100%;
			height: 750rpx;
			position: absolute;
			bottom: 0;
			left: 0;
			z-index: 10;
		}
	}

	.top-content {
		position: relative;
		z-index: 11;
		padding: 340rpx 0 0rpx;

		.banner {
			width: 100%;
			height: 320rpx;
		}

		.content-box {
			// padding: 0 24rpx 140rpx;

			.title-flex {
				//   height: 115rpx;
				padding: 40rpx 0 20rpx;
				display: flex;
				align-items: center;
				justify-content: space-between;

				&.spe {
					.title {
						font-family: PingFang SC;
						font-weight: 500;
						font-size: 24rpx;
						color: var(--maincolorf1);
						line-height: 24rpx;
						display: flex;
						align-items: center;

						.title-icon {
							width: 16rpx;
							height: 20rpx;
							background-image: url('https://oss.jtmckj.com/wmp/kbq/common/i_icon_address.png');
							background-size: cover;
							background-repeat: no-repeat;
							background-position: center;
							margin-right: 8rpx;
						}

						.addres-text {
							width: 500rpx;
							white-space: nowrap;
							overflow: hidden;
							text-overflow: ellipsis;
						}
					}

					.orgecode {
						font-family: PingFang SC;
						font-weight: bold;
						font-size: 32rpx;
						color: var(--maincolorf1);
						line-height: 32rpx;
					}
				}

				.title {
					color: var(--maincolorf1);
					font-size: 24rpx;
				}

				.orgecode {
					color: var(--maincolorf1);
					font-size: 30rpx;
				}

				.call {
					width: 200rpx;
					height: 48rpx;
					background: var(--mainbaccolor10);
					border-radius: 8rpx;
					display: flex;
					align-items: center;

					.kfimg {
						width: 40rpx;
						height: 40rpx;
						margin: 0 9rpx 0 16rpx;
					}

					.call-title {
						font-family: PingFang SC;
						font-weight: 500;
						font-size: 24rpx;
						color: var(--maincolorf1);
						line-height: 24rpx;
					}
				}
			}

		}

	}


	.home-container {
		width: 100%;
		height: 100%;
		overflow: scroll;
		background: var(--mainbaccolor);

		.home-wrapper {
			padding: 0 24rpx;
			box-sizing: border-box;
		}

		.home-logo {
			padding-top: 105rpx;
			text-align: center;
			font-size: 0;

			&-image {
				width: 112rpx;
				height: 100rpx;
			}
		}

		.home-sublogo {
			padding-top: 34rpx;
			text-align: center;
			font-size: 0;

			&-image {
				width: 564rpx;
				height: 212rpx;
			}
		}

		.home-wifi {
			display: flex;
			justify-content: flex-end;
			padding-top: 9rpx;

			&-button {
				display: flex;
				align-items: center;
				background-color: var(--mainbaccolor19);
				padding: 8rpx 16rpx;
				font-size: 0;
				border-radius: 4rpx;
			}

			&-image {
				width: 24rpx;
				height: 24rpx;
			}

			&-text {
				font-family: PingFang SC;
				font-weight: 500;
				font-size: 24rpx;
				color: var(--maincolor);
				line-height: 24rpx;
			}
		}

		.home-main {
			// background: #000000;
			border-radius: 60rpx 60rpx 0rpx 0rpx;
			// padding: 0 16rpx 140rpx;
			box-sizing: border-box;
			margin-top: 18rpx;

			&-heading {
				display: flex;
				justify-content: space-between;
				align-items: center;
				padding: 40rpx 20rpx 0rpx 40rpx;
				box-sizing: border-box;
			}

			&-user {
				display: flex;
				align-items: center;
				padding-bottom: 40rpx;
			}

			&-user__cover {
				width: 80rpx;
				height: 80rpx;
				border-radius: 50%;
				background-repeat: no-repeat;
				background-size: cover;
			}

			&-user__nickname {
				font-family: PingFang SC;
				font-weight: 500;
				font-size: 32rpx;
				color: var(--maincolor);
				line-height: 32rpx;
				padding-left: 16rpx;
				overflow: hidden;
				text-overflow: ellipsis;
				white-space: nowrap;
				width: 210rpx;
			}

			&-location {
				font-family: PingFang SC;
				font-weight: 500;
				font-size: 24rpx;
				color: var(--maincolorf6);
				line-height: 24rpx;
				padding: 28rpx 18rpx 0 22rpx;
				position: relative;
				overflow: hidden;
				/* 隐藏溢出内容 */
				white-space: nowrap;
				/* 不换行 */
				text-overflow: ellipsis;
				/* 使用省略号表示溢出内容 */

				&::before {
					content: '';
					position: absolute;
					top: 16rpx;
					left: 0;
					width: 20rpx;
					height: 100%;
					background-image: url('https://oss.jtmckj.com/wmp/images/home/index/i_icon_location.png');
					background-size: 100% auto;
					background-position: left center;
					background-repeat: no-repeat;
				}

				&::after {
					content: '';
					position: absolute;
					top: 16rpx;
					right: 0;
					width: 18rpx;
					height: 100%;
					background-image: url('https://oss.jtmckj.com/wmp/images/home/index/i_icon_into.png');
					background-size: 100% auto;
					background-position: right center;
					background-repeat: no-repeat;
				}
			}
		}

		.home-main-table {
			color: var(--dt-colorPink);
			padding: 28rpx 0 24rpx;
		}

		.home-menu {
			// flex: 1;
			margin-bottom: 20rpx;

			&-list {
				display: flex;
				justify-content: space-between;
				flex-wrap: wrap;
			}

			&-item {
				display: flex;
				background-size: 100% 100%;
				box-sizing: border-box;

				&__info {
					display: flex;
					flex-direction: column;
					justify-content: space-between;
				}

				&.primary {
					width: 324rpx;
					padding: 53rpx 0;
					background-image: url('https://oss.jtmckj.com/wmp/images/home/index/i_menu_bg_primary.png');
					margin-top: 20rpx;
					padding-left: 64rpx;

					.home-menu-item__icon {
						width: 54rpx;
						height: 54rpx;
					}

					.home-menu-item__info {
						padding-left: 16rpx;
					}

					.home-menu-item__title {
						font-family: PingFang SC;
						font-weight: bold;
						font-size: 32rpx;
						color: var(--maincolor);
						line-height: 32rpx;
					}

					.home-menu-item__subtitle {
						font-family: PingFang SC;
						font-weight: 400;
						font-size: 24rpx;
						color: var(--maincolor);
						line-height: 24rpx;
						transform: scale(0.83);
						transform-origin: left;
						white-space: nowrap;
					}
				}

				&.full {
					width: 100%;
					padding: 70rpx 0;
					background-image: url('https://oss.jtmckj.com/wmp/images/home/index/i_menu_bg_full.png');
					padding-left: 248rpx;

					.home-menu-item__icon {
						width: 60rpx;
						height: 60rpx;
					}

					.home-menu-item__info {
						padding-left: 24rpx;
					}

					.home-menu-item__title {
						font-family: PingFang SC;
						font-weight: bold;
						font-size: 36rpx;
						color: var(--maincolor);
						line-height: 36rpx;
					}

					.home-menu-item__subtitle {
						font-family: PingFang SC;
						font-weight: 400;
						font-size: 24rpx;
						color: var(--maincolor);
						line-height: 24rpx;
					}
				}
			}

		}

		.home-toPing {
			height: 100rpx;
			background-image: url('https://oss.jtmckj.com/wmp/images/home/index/i_home_toPing.png');
			background-size: 100% auto;
			background-position: right center;
			background-repeat: no-repeat;
		}
	}

	.popup-wine {
		padding-left: 16rpx;
		padding-bottom: 20rpx;

		&-title {
			font-family: PingFang SC;
			font-weight: bold;
			font-size: 36rpx;
			color: var(--maincolorf1);
			line-height: 36rpx;
			padding: 20rpx 0 0 10rpx;
		}

		.titleName {
			color: var(--dt-colorPink);
		}

		&-top {
			display: flex;
			align-items: center;
			padding: 40rpx 0 0 40rpx;
			font-family: PingFang SC;
			font-weight: bold;
			font-size: 36rpx;
			color: var(--maincolor);
			line-height: 36rpx;
		}

		&-control {
			width: 460rpx;
			display: flex;
			justify-content: space-between;
			box-sizing: border-box;
			// padding: 0 48rpx 28rpx;
		}

		&-btn {
			border-radius: 16rpx;
			background: var(--dt-backcolorPink) !important;
			padding: 30rpx 0;
			width: 200rpx;
			font-family: PingFang SC;
			font-weight: 500;
			font-size: 32rpx;
			color: var(--maincolor);
			line-height: 32rpx;
			text-align: center;
			position: relative;
			// &::after {
			// 	content: '';
			// 	position: absolute;
			// 	top: 42rpx;
			// 	right: 45rpx;
			// 	width: 12rpx;
			// 	height: 22rpx;
			// 	background-image: url('https://oss.jtmckj.com/wmp/images/common/i_triangle_right.png');
			// 	background-size: 100% auto;
			// 	background-repeat: no-repeat;
			// }
		}

		&-h2 {
			padding: 0 0 40rpx 48rpx;
			font-family: PingFang SC;
			font-weight: 500;
			font-size: 32rpx;
			color: var(--maincolor);
			line-height: 32rpx;
		}

		.van-radio__label {
			font-family: PingFang SC;
			font-weight: 500;
			font-size: 32rpx;
			color: var(--maincolor);
			line-height: 32rpx;
		}

		.van-radio-group--horizontal {
			justify-content: space-between;
			padding: 0 100rpx 25rpx 48rpx;
		}

		.van-radio--horizontal {
			margin: 0;
		}

		.feedback-value {
			background: var(--mainbaccolor20);
			border-radius: 16rpx;
			padding: 25rpx 24rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			margin: 0 48rpx;

			.value-text {
				font-family: PingFang SC;
				font-weight: 500;
				font-size: 32rpx;
				color: var(--maincolorf2);
				line-height: 32rpx;
			}

			.value-right {
				display: flex;
				align-items: center;

				.right-value {
					font-family: PingFang SC;
					font-weight: 500;
					font-size: 32rpx;
					color: var(--maincolor);
					line-height: 32rpx;
					padding-right: 16rpx;
				}

				.right-icon {
					width: 12rpx;
					height: 22rpx;
					background-image: url('https://oss.jtmckj.com/wmp/images/center/i_icon_tra-right.png');
					background-size: 100% 100%;
					background-repeat: no-repeat;
				}
			}
		}
	}

	.popup-container {
		padding-bottom: 40rpx;

		.popup-container-header {
			display: flex;
			align-items: center;
			justify-content: space-between;
			// padding: 33rpx 60rpx 32rpx;
			border-bottom: 1px solid var(--maincolorbd11);

			.header-left {
				font-family: PingFang SC;
				font-weight: 500;
				font-size: 32rpx;
				color: var(--maincolorf4);
				line-height: 32rpx;
				padding: 33rpx 60rpx 32rpx;
			}

			.header-center {
				font-family: PingFang SC;
				font-weight: bold;
				font-size: 36rpx;
				color: var(--maincolorf15);
				line-height: 36rpx;
			}

			.header-right {
				font-family: PingFang SC;
				font-weight: 500;
				font-size: 32rpx;
				color: var(--maincolorf1);
				line-height: 32rpx;
				padding: 33rpx 60rpx 32rpx;
			}
		}

		.popup-container-main {
			padding: 20rpx 24rpx 0;
			display: flex;
			align-items: center;
			justify-content: flex-start;
			flex-wrap: wrap;

			.main-item {
				background: var(--mainbaccolor21);
				border-radius: 8rpx;
				font-family: PingFang SC;
				font-weight: 500;
				font-size: 32rpx;
				color: var(--maincolor);
				line-height: 80rpx;
				text-align: center;
			}

			.van-col {
				margin-bottom: 20rpx;
			}

		}

		.popup-container-footer {
			margin: 0 24rpx 160rpx;
			background: var(--mainbaccolor20);
			border-radius: 16rpx;
			padding: 24rpx 0rpx 4rpx 24rpx;
			display: flex;
			align-items: center;
			justify-content: flex-start;
			flex-wrap: wrap;

			.footer-item {
				// width: 118rpx; 
				padding: 0 26rpx;
				height: 60rpx;
				background: var(--mainbaccolor21);
				border-radius: 8rpx;
				text-align: center;
				margin-bottom: 20rpx;
				font-family: PingFang SC;
				font-weight: 500;
				font-size: 28rpx;
				color: var(--maincolor);
				line-height: 60rpx;
				margin-right: 16rpx;
			}
		}
	}

	.popup-login {
		&-title {
			font-family: PingFang SC;
			font-weight: bold;
			font-size: 36rpx;
			color: var(--maincolorf1);
			line-height: 36rpx;
			padding: 60rpx 0 0 48rpx;
		}

		&-top {
			// display: flex;
			// align-items: center;
			padding: 60rpx 0 0 0rpx;
			font-family: PingFang SC;
			font-weight: bold;
			font-size: 36rpx;
			color: var(--maincolorf1);
			line-height: 36rpx;
		}

		.top-title {
			text-align: center;
		}

		&-control {
			display: flex;
			justify-content: space-between;
			box-sizing: border-box;
			padding: 0 48rpx 68rpx;
			text-align: center;
		}

		&-btn {
			border-radius: 16rpx;
			background: var(--mainbaccolor4);
			// border: 1px solid #212121;
			padding: 34rpx 0;
			width: 230rpx;
			font-family: PingFang SC;
			font-weight: 500;
			font-size: 32rpx;
			color: var(--maincolor);
			line-height: 32rpx;
			text-align: center;
			position: relative;

		}

		&-h2 {
			padding: 0 0 40rpx 48rpx;
			font-family: PingFang SC;
			font-weight: 500;
			font-size: 32rpx;
			color: var(--maincolor);
			line-height: 32rpx;
		}

	}

	.tab-bar {
		position: fixed;
		bottom: 0;
		width: 100%;
		z-index: 900;
		// padding-bottom: constant(safe-area-inset-bottom); // 兼容 IOS 11.2 以下
		// padding-bottom: env(safe-area-inset-bottom); // 兼容 IOS 11.2 以上
	}

	.tab-bar-list {
		width: 100%;
		background: var(--maincolor);
		pointer-events: auto;
		position: relative;
		// padding: 10rpx 0 20rpx 0;
		display: flex;
		justify-content: center;
		align-items: center;
		padding-bottom: env(safe-area-inset-bottom); // 适配iphoneX的底部
	}

	.footer-tab-box {
		width: 100%;
		padding: 0 32rpx;
		display: flex;
		justify-content: space-between;
	}

	.tab-bar-item {
		flex: 1;
		text-align: center;
		display: flex;
		justify-content: center;
		align-items: center;
		flex-direction: column;
		position: relative;
		padding: 5px 0;

		&.active {
			background-color: var(--maincolor);
		}
	}

	.tab-bar-item .tab-bar-icon {
		width: 44rpx;
		height: 44rpx;
	}

	.tab-bar-item .tab-bar-text {
		font-size: 10px;
		padding-top: 1px;
	}


	.pz-img-box {
		//   margin-top: 24rpx;
		//   width: 750rpx;
		display: flex;
		align-items: center;
		//   justify-content: space-between;
		//   overflow-x: auto;
		overflow: hidden;

		.scroll-view {
			width: 100%;
			overflow: hidden;
			white-space: nowrap;
			/* 防止换行 */
		}

		.img-box-item {
			display: inline-block;
			/* 让子项水平排列 */
			width: 100%;
			height: 120rpx;
			margin-right: 20rpx;

			// margin-right: 22rpx;
			.item-img {
				margin: 0;
				padding: 0;
				border: 0;
				display: block;
				/* 防止图片下方出现空白行 */
				height: 120rpx;
				width: 100%;
			}
		}

		image {
			width: 100%;
			height: 100%;
		}
	}


	// 青年酒馆css

	.home-main {
		// background: #000000;
		border-radius: 60rpx 60rpx 0rpx 0rpx;
		padding: 0rpx 0 140rpx;
		box-sizing: border-box;
		margin: 0 24rpx;
		margin-top: 12rpx;

		&-heading {
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 0rpx 20rpx 0rpx 40rpx;
			box-sizing: border-box;
		}

		&-user {
			display: flex;
			align-items: center;
			padding-bottom: 20rpx;
		}

		&-user__cover {
			width: 80rpx;
			height: 80rpx;
			border-radius: 50%;
			background-repeat: no-repeat;
			background-size: cover;
		}

		&-user__nickname {
			font-family: PingFang SC;
			font-weight: 500;
			font-size: 32rpx;
			color: #ffffff;
			// color: rgba(255, 255, 255, .5);
			line-height: 32rpx;
			padding-left: 16rpx;
			overflow: hidden;
			text-overflow: ellipsis;
			white-space: nowrap;
			width: 210rpx;
			// height: 60rpx;
			// background-color: #212121;
		}

		.toLogin {
			font-family: PingFang SC;
			font-weight: 500;
			font-size: 32rpx;
			color: #212121;
			line-height: 80rpx;
			padding-left: 16rpx;
			overflow: hidden;
			text-overflow: ellipsis;
			white-space: nowrap;
			width: 210rpx;
			height: 80rpx;
		}

		&-location {
			font-family: PingFang SC;
			font-weight: 500;
			font-size: 24rpx;
			color: #ffffff;
			line-height: 24rpx;
			padding: 28rpx 18rpx 0 22rpx;
			position: relative;
			overflow: hidden;
			/* 隐藏溢出内容 */
			white-space: nowrap;
			/* 不换行 */
			text-overflow: ellipsis;
			/* 使用省略号表示溢出内容 */

			&::before {
				content: '';
				position: absolute;
				top: 16rpx;
				left: 0;
				width: 20rpx;
				height: 100%;
				background-image: url('https://oss.jtmckj.com/wmp/images/home/index/i_icon_location.png');
				background-size: 100% auto;
				background-position: left center;
				background-repeat: no-repeat;
			}

			&::after {
				content: '';
				position: absolute;
				top: 16rpx;
				right: 0;
				width: 18rpx;
				height: 100%;
				background-image: url('https://oss.jtmckj.com/wmp/images/home/index/i_icon_into.png');
				background-size: 100% auto;
				background-position: right center;
				background-repeat: no-repeat;
			}
		}

		&-table {
			font-family: PingFang SC;
			font-weight: 500;
			font-size: 24rpx;
			color: #FFAA00;
			line-height: 24rpx;
			text-align: right;
			padding: 14rpx 0 12rpx;
		}
	}


	.home-top-menu {
		display: flex;
		align-items: center;
		border-radius: 16rpx;
		overflow: hidden;

		.home-top-menu-item {
			background-color: #fff;
			text-align: center;
			width: 50%;
			padding: 20rpx 0;

			.menu-title {
				font-weight: bold;
				color: #212121;
				font-size: 34rpx;
			}

			.menu-eTitle {
				color: #999999;
				font-size: 20rpx;
				padding: 10rpx;
			}
			.menu-table{
				// width: 54rpx;
				height: 58rpx;
				font-family: PingFang SC;
				font-weight: bold;
				font-size: 48rpx;
				color: var(--dt-colorPink);
				line-height: 48rpx;
				position: relative;
				.menu-table-img{
					position:absolute;
					width: 16rpx;
					height: 26rpx;
					top: 12rpx;
					padding-left: 10rpx;
				}
				
			}
			image {
				width: 54rpx;
				height: 54rpx;
			}
		}
	}

	.home-bottom-menu {
		display: flex;
		align-items: center;
		background-color: #fff;
		border-radius: 16rpx;
		margin-top: 20rpx;
		box-sizing: border-box;
		padding: 20rpx 0;
		margin-bottom: 16rpx;

		.home-bottom-menu-item {
			width: 25%;
			text-align: center;
			color: #666666;
			font-size: 24rpx;

			image {
				width: 44rpx;
				height: 44rpx;
				margin-bottom: 12rpx;
			}

			view {
				border-right: 2rpx solid #E6E6E6;
				color: #666666;
			}
		}

		.home-bottom-menu-item:last-child view {
			border-color: transparent;
		}
	}

	.home-banner {
		.home-banner-up {
			position: relative;
			width: 100%;
			height: 120rpx;
			margin: 0 0 14rpx;
			margin-bottom: 20rpx;
			// background-image:url('https://jtmc.oss-cn-hangzhou.aliyuncs.com/wmp/qnjg/index/banner01.png');
			background-repeat: no-repeat;
			background-size: 100% 100%;
			border-radius: 16rpx;

			.upgrade {
				position: absolute;
				top: 30rpx;
				right: 20rpx;
				width: 160rpx;
				height: 60rpx;
				background: var(--dt-backcolorPink);
				border-radius: 30rpx;
				text-align: center;
				line-height: 60rpx;
				font-weight: 500;
				font-size: 28rpx;
				color: var(--maincolor);
			}
		}

		image {
			width: 100%;
			height: 240rpx !important;
			margin: 6rpx 0;
		}
	}

	::v-deep .u-safe-bottom {
		display: none !important;
	}

	.activityShow-content {
		text-align: center;
		min-width: 500rpx;
		z-index: 999;
		.activityShow-title {
			padding-top: 10rpx;
			font-size: 36rpx;
			font-weight: bold;

		}

		.activityShow-btn {
			width: 280rpx;
			height: 60rpx;
			border: 4rpx solid var(--dt-bordercolorPink);
			font-weight: bold;
			border-radius: 40rpx;
			font-family: PingFang SC;
			font-size: 32rpx;
			color: var(--dt-colorPink);
			line-height: 60rpx;
			text-align: center;
			margin: 0 auto;
		}
	}

	.adv-popup {
		::v-deep {
			.u-popup__content {
				background: transparent;
			}

			.popup-content {
				padding: 0;
			}
		}

		.close {
			position: absolute;
			width: 48rpx;
			height: 48rpx;
			top: 20rpx;
			right: 20rpx;
			z-index: 10;
		}

		.wh100 {
			width: 600rpx;
			height: 800rpx;
			border-radius: 24rpx;
			background-size: contain;
			background-position: center;
			background-repeat: no-repeat;
		}
	}
</style>